<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layuiAdmin 控制台主页一</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/console.css" media="all">
</head>
<body>
<div class="layui-fluid">
  <div class="layui-card" style="height: 65%; min-height: 400px;">
    <div id="main" style="width:100%;height:100%;"></div>
    <div class="layui-card-body total">
      <h4>今日统计</h4>
      <div class="total_content">
        <div class="layui-form-item">
          <span class="layui-col-md5 total_item">今日采购订单（笔）</span>
          <div class="layui-col-md5">
            <div class="layui-progress layui-progress-big"  lay-filter="total0">
              <div class="layui-progress-bar layui-bg-blue"></div>
            </div>
          </div>
          <span class="layui-prgress-text">300</span>
        </div>
        <div class="layui-form-item">
          <span class="layui-col-md5 total_item">今日新增线索(个)</span>
          <div class="layui-col-md5">
            <div class="layui-progress layui-progress-big" lay-filter="total1">
              <div class="layui-progress-bar layui-bg-orange"></div>
            </div>
          </div>
          <span class="layui-prgress-text">300</span>
        </div>
        <div class="layui-form-item">
          <span class="layui-col-md5 total_item">库存持有60天以上(辆)</span>
          <div class="layui-col-md5">
            <div class="layui-progress layui-progress-big" lay-filter="total2">
              <div class="layui-progress-bar layui-bg-pink"></div>
            </div>
          </div>
          <span class="layui-prgress-text">300</span>
        </div>
        <div class="layui-form-item">
          <span class="layui-col-md5 total_item">在库车辆合计(辆)</span>
          <div class="layui-col-md5">
            <div class="layui-progress layui-progress-big" lay-filter="total3">
              <div class="layui-progress-bar layui-bg-blue"></div>
            </div>
          </div>
          <span class="layui-prgress-text">300</span>
        </div>
        <div class="layui-form-item">
          <span class="layui-col-md5 total_item">门店数量合计(个)</span>
          <div class="layui-col-md5">
            <div class="layui-progress layui-progress-big" lay-filter="total4">
              <div class="layui-progress-bar layui-bg-green"></div>
            </div>
          </div>
          <span class="layui-prgress-text">300</span>
        </div>
      </div>
    </div>
  </div>
  <div class="layui-card" style="height: 33%">
    <div id="echart" style="width:100%;height:100%;"></div>
  </div>
</div>
<script src="../../layuiadmin/layui/layui.js"></script>
<script src="../../layuiadmin/modules/jquery.js"></script>
<script src="../../layuiadmin/modules/home/echarts.min.js"></script>
<script src="../../layuiadmin/modules/home/china.js"></script>
<script src="../../layuiadmin/modules/home/area_echarts.js"></script>
<script>
    layui.config({
        base: '../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','element','jquery'],function () {
        var $ =layui.jquery,
            element = layui.element;
        //取数组最大值
        Array.prototype.max = function() {
            var max = this[0];
            var len = this.length;
            for (var i = 1; i < len; i++){
                if (this[i] > max) {
                    max = this[i];
                }
            }
            return max;
        }
        var percent = [];
        var progressData = [30,269,200,250,116];
        var max = progressData.max();
        for(var i=0;i<progressData.length;i++){
            percent.push(parseInt(progressData[i]/max*100)+"%")
        }
        $(".layui-prgress-text").each(function (e) {
            $(this).text(progressData[e]);
            $(this).css("width",progressData[e])
        });
        $(".layui-progress-bar").each(function (e) {
            element.progress('total'+ e +'', percent[e]);
        });
    });
</script>
</body>
</html>

